<script src="<?=base_url(); ?>theme/js/main.js"></script>
<script>
    $(document).ready(function(){
        $('#regresar').click(function(){
            $('.data_tbl').fadeIn('fast');
            $('.table_bottom').fadeIn('fast');
            $('#view_stock').fadeOut('show');
        })
    })
</script>
<div class="widget_wrap">
    
                                    
                                       
                                   
                                        <h1 id="dataProduct" code="<?php  echo $code ?>" price="<?php  echo $listStock2->price; ?>"><?php   echo $code ?> - <?php echo $listStock2->description ?></h1>
                                        <p>Caja X <?php echo $listStock2->box_packs; ?> DOC</p>
                                        <div class="widget_content">
                                                    <table id="productTable" class="wtbl_list">
                                                    <thead>
                                                            <tr>
                                                                    <th>Almacén</th>
                                                                    <th>Cajas</th>
                                                                    <th>Empaques</th>
                                                                   <th>Unidades</th>
                                                            </tr>
                                                    </thead>
                                                    <tbody>
                                                        <?php


              $i=0;
                            foreach( $listStock2 as $st){
                            $i++;
                        ?>
                     <table border='0' rules="all" cellpadding="0" cellspacing="0" class='wtbl_list CityTable'>
                       <thead>
                       <tr width="100%">
                        <th width="40%"><input style="width:20px;" type="hidden"  id="cod_almacen<?php echo $i; ?>" name="cod_almacen<?php echo $i; ?>" value="<?php echo $st->id; ?>"><span align="left"><?php echo $i.")";?></span><?php echo $st->name; ?></th>
                         <th width="20%" align="center"><input align="center" class="unitdisponible_<?php echo $i; ?>" value="<?php echo $total_unidades_x_caja_pakete_unidad =  (($productData->box_packs * $productData->pack_units) *  $st->boxes) + ($st->packs * $productData->pack_units ) + $st->Units; ?>" style="width:40px" disabled/></th>
                        <th width="20%" align="center"><input class="cantUnits onlyNumber" id="caja<?php echo $i; ?>" name="caja<?php echo $i; ?>" type="" style="width:40px" placeholder="0" /></th>
                        <th width="20%" align="center"><input class="cantUnits onlyNumber" id="paquete<?php echo $i; ?>" name="paquete<?php echo $i; ?>" type="text"  style="width:40px" placeholder="0" /></th>
                        <th width="20%" align="center"><input class="cantUnits onlyNumber" id="unidad<?php echo $i; ?>" name="unidad<?php echo $i; ?>" type="text" style="width:40px" placeholder="0" /></th>
                       </tr>
                       </thead>
                       
                   
                         <?php
                         $j=0;
                            foreach( $subwarehouses as $s ){
                             $j++;
                             if($st->id == $s->id_warehouse)
                             {
                        ?>
                        <tbody>
                            <tr width="100%">
                           
                        <td width="40%" align="left"><input style="width:20px;" type="hidden"  id="cod_almacen<?php echo $i; ?>" name="cod_almacen<?php echo $i; ?>" value="<?php echo $s->id_warehouse; ?>"><span align="left">       <?php echo $i.")";  ?></span> <?php echo $s->name; ?></td>
                        <td></td>
                        <td width="20%" align="center"><input class="cantUnits onlyNumber" id="caja<?php echo $i; ?>" name="caja<?php echo $i; ?>" type="" style="width:40px" placeholder="0" /></td>
                        <td width="20%" align="center"><input class="cantUnits onlyNumber" id="paquete<?php echo $i; ?>" name="paquete<?php echo $i; ?>" type="text"  style="width:40px" placeholder="0" /></td>
                        <td width="20%" align="center"><input class="cantUnits onlyNumber" id="unidad<?php echo $i; ?>" name="unidad<?php echo $i; ?>" type="text" style="width:40px" placeholder="0" /></td>
                        </tr>                                          
                        </tbody>

                        <?
                    }
                        }
                        ?>                        
                     </table>
          
                                                 
                                                    <br />
                                                    <input id="totalUnits" class="" type="hidden" />

                                            </div>
                                     <?
                        } ?>
  </div>

<button id="regresar"  class="closeModel btn_small btn_blue simplemodal-close"><span>Regresar</span></button>
